package com.meilai.project.controller.web.report.mapper;

import com.meilai.project.controller.web.report.entity.*;
import com.meilai.project.controller.web.report.vo.AppWorkOrderProcessDetailVO;
import com.meilai.project.controller.web.report.vo.AppWorkerProcessVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author chenxing
 */
@Mapper
public interface WorkOrderReportMapper {

    List<Integer> summaryTotalCount(@Param("type") Integer type, @Param("userId") Long userId, @Param("work_order_type_id") Long work_order_type_id);

    List<Integer> summarySubmitCount(@Param("type") Integer type,  @Param("userId") Long userId);

    Integer summarySaleMediaPointCount(@Param("saleBillIds") List<Long> saleBillIds);

    Integer summaryWorkOrderMediaPointCount(@Param("workOrderIds") List<Long> workOrderIds);

    Integer summaryWorkOrderInstallMediaPointCount(@Param("workOrderIds") List<Long> workOrderIds);

    Integer summaryHasSubmitMediaPointCount(@Param("workOrderIds") List<Integer> workOrderIds);

    List<TypeCount> summaryTypeTotalCount(@Param("type") Integer type, @Param("userId") Long userId);

    List<TypeCount> summaryTypeSubmitCount(@Param("type") Integer type, @Param("userId") Long userId);

    List<TypeCount> summaryTypeBuildingCount(@Param("type") Integer type, @Param("userId") Long userId);

    List<TypeCount> summaryTypeCustomerCount(@Param("type") Integer type, @Param("userId") Long userId);

    List<TypeCount> summaryPersonTotalCount(@Param("type") Integer type);

    List<TypeCount> summaryPersonSubmitCount(@Param("type") Integer type);

    List<TypeCount> summaryPersonBuildingCount(@Param("type") Integer type);

    List<TypeCount> summaryPersonCustomerCount(@Param("type") Integer type);

    List<AppWorkOrderReport> workOrderCustomerProcess(@Param("type") Integer type,
                                                      @Param("userId") Long userId, @Param("work_order_type_id") Long work_order_type_id,
                                                        @Param("media_type_id") Long media_type_id);

    List<AppNewInstallWorkOrderReport> workOrderBuildingNewInstallProcess(@Param("type") Integer type,
                                                                          @Param("userId") Long userId, @Param("work_order_type_id") Long work_order_type_id,
                                                                          @Param("media_type_id") Long media_type_id,
                                                                          @Param("workOrderIdList") List<Long> workOrderIdList);

    List<Long> workOrderBuildingNewInstallProcessIdList(@Param("type") Integer type,
                                                        @Param("userId") Long userId, @Param("work_order_type_id") Long work_order_type_id,
                                                        @Param("media_type_id") Long media_type_id);

    List<AppWorkOrderReport> workOrderBuildingProcess(@Param("type") Integer type,
                                                      @Param("userId") Long userId, @Param("work_order_type_id") Long work_order_type_id,
                                                        @Param("media_type_id") Long media_type_id);

    List<AppWorkOrderProcessDetailVO> workOrderProcessDetail(@Param("notSubmitMediaPointIdList") List<Long> notSubmitMediaPointIdList);

    List<Long> workOrderProcessCustomerNotSubmitMediaPointIdList(
            @Param("type") Integer type,
            @Param("userId") Long userId,
            @Param("building_area_id") Long building_area_id,
            @Param("work_order_type_id") Long work_order_type_id,
            @Param("work_order_Id") Long work_order_Id);

    List<Long> workOrderProcessBuildingNotSubmitMediaPointIdList(
            @Param("type") Integer type,
            @Param("userId") Long userId,
            @Param("building_area_id") Long building_area_id,
            @Param("work_order_type_id") Long work_order_type_id
    );

    List<AppWorkerProcessVO> mediaTypeSaleCount(
            @Param("workOrderIdList") List<Long> billSaleIds
    );

    List<AppWorkerProcessVO> mediaTypeNewInstallWorkOrderCount(@Param("workOrderIds") List<Long> workOrderIds);

    List<AppWorkerProcessVO> mediaTypeWorkOrderCount(
            @Param("workOrderIds") List<Long> workOrderIds
    );

    List<BillMarketShootRequirementExt> queryCustomerDetail(
            @Param("workOrderIdList") List<Long> workOrderIds,
            @Param("media_type_id") Long media_type_id
    );
}
